import java.util.*;

public class Main {
    public static int gcd(int a, int b) {
        while (b != 0) {
            int temp = b;
            b = a % b;
            a = temp;
        }
        return a;
    }

    public static int lcm(int a, int b) {
        return a / gcd(a, b) * b; // 防止溢出
    }
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
//        Map<Integer,Integer> map = new HashMap<>();
        int[] nums = new int[4];
//        key = 1代表字母，2代表数字 3空格 4其他
        for(int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            if(ch >= 'A' && ch <= 'Z'){
                nums[0]++;
            }else if(ch >= 'a' && ch <= 'z'){
                nums[0]++;
            }else if(ch >= '0' && ch <= '9'){
                nums[1]++;
            }else if(ch == ' '){
                nums[2]++;
            }else{
                nums[3]++;
            }
        }
        for(int i=0;i<4;i++){
            System.out.print(nums[i]);
            System.out.print(' ');
        }
        System.out.println();
    }
}
